package Kuaishou;

import java.util.Collections;
import java.util.List;

import org.apache.commons.collections.CollectionUtils;

import com.google.common.collect.Lists;

/**
 * @author leiwenkang <leiwenkang@kuaishou.com>
 * Created on 2021-09-13
 */
public class Test46取交集 {
    public static void main(String[] args) {
        List<Integer> list1 = Lists.newArrayList();
        list1.add(1);
        list1.add(2);
        list1.add(3);

        List<Integer> list2 = Lists.newArrayList();
        list2.add(2);
        list2.add(3);
        list2.add(4);

//        list1.retainAll(list2);

        System.out.println(CollectionUtils.intersection(list1, list2));
    }
}
